package web;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.swing.text.html.ListView;

import clientePJ.ClientePJ;
import clientePJ.ClientePJRN;

import clientePJ.ClientePJDAO;
import clientePJ.ClientePJDAOImplements;




@ManagedBean(name = "clienteBeanPJ")
@ViewScoped
public class ClienteBeanPJ {

	private List<ClientePJ> buscarGeral = new ArrayList<ClientePJ>();			
	ClientePJ clientePJ = new ClientePJ();
	
	public String salvar (){
		
		ClientePJRN clientePJRN = new ClientePJRN();
		clientePJRN.salvarClientePJ(clientePJ);	
		return null;
	}

	public ClientePJ getCliente() {
		return clientePJ;
	}

	public void setCliente(ClientePJ cliente) {
		this.clientePJ = clientePJ;
	}
	
	public List<ClientePJ> buscarGeralCliente() {
		
		this.buscarGeral = new ArrayList<ClientePJ>();
		ClientePJRN tRN = new ClientePJRN();
		buscarGeral = tRN.listar();
		return buscarGeral;

	}	
	
	public ClientePJ buscarClientePorID(int id) {
		
		ClientePJRN cRN = new ClientePJRN();
		ClientePJ clientePJ;
		clientePJ = cRN.buscaClientePorID(id);
		return clientePJ;

	}
	
	public List<ClientePJ> listar() {
			
			return buscarGeralCliente(); 
			
		}
	
	public List<ClientePJ> getBuscarGeral() {
		return buscarGeral;
	}
	
	public void setBuscarGeral(List<ClientePJ> buscarGeral) {
		this.buscarGeral = buscarGeral;
	}

	public ClientePJ getClientePJ() {
		return clientePJ;
	}

	public void setClientePJ(ClientePJ clientePJ) {
		this.clientePJ = clientePJ;
	}
	
	
		
		
}
